/**
 * @ClassName DepartmentController
 * @Description TODO
 * @Author 沉默小吴
 * @Date 2024/12/17 14:49
 */
package com.tledu.operate.count.controller;

import com.tledu.operate.count.entity.Department;
import com.tledu.operate.count.service.IDepartmentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/api")
@CrossOrigin(origins = "http://localhost")
public class DepartmentController {

    @Autowired
    private IDepartmentService departmentServiceimpl;

    @GetMapping("/departments")
    public List<Department> getDepartments() {
        return departmentServiceimpl.getAllDepartments();
    }
}